import requests
class TestReg:
    def test_reg_success(self):
        session = requests.session()
        session.get("http://tpshop-test.itheima.net/index.php?m=Home&c=User&a=verify&type=user_reg&r=0.6326625486156849")
        login_url = "http://tpshop-test.itheima.net/Home/User/reg.html"
        header = {"Content-Type": "application/x-www-form-urlencoded"}
        body = {"username":13370589933,"verify_code":8888,"password":"123456","password2":"123456"}
        resp = session.post(url=login_url,headers=header,data=body)
        print(resp.json())

    # 断言
        assert 1 == resp.json().get('status')
        assert '注册成功' == resp.json().get('msg')